/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import Model.BD.DAO;
import Model.Banco;
import com.icesoft.faces.component.jsfcl.data.DefaultSelectionItems;
import java.util.List;
import javax.faces.model.SelectItem;

/**
 *
 * @author Uso Exclusivo
 */
public class BancoBO {

   public DAO<Banco> getDAO() {
      return new DAO<Banco>(Banco.class);
   }

   public DefaultSelectionItems montaLista(List<Banco> lista) {
      DefaultSelectionItems itens = new DefaultSelectionItems();
      itens.clear();
      int i = 0;
      while (i < lista.size()) {
         itens.add(new SelectItem(lista.get(i).getCodbanco(), lista.get(i).getNome()));
         i++;
      }
      return itens;
   }
}
